package com.yaorange.controller;

import com.yaorange.api.vo.Result;
import com.yaorange.entity.ArticleType;
import com.yaorange.service.ArticleTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @company: yaorange
 * @author: CorJ
 * @version: 1.0
 * @create: 2021-11-29 17:58
 */
@RestController
@RequestMapping("/articleType")
public class ArticleTypeController {
    @Autowired
    private ArticleTypeService articleTypeService;
    @GetMapping("/list")
    public Result<?> getTypeList(){
        List<ArticleType> articleTypeList = articleTypeService.findAll();
        if(articleTypeList!=null){
            return Result.ok(articleTypeList);
        }
        return null;
    }
}
